package com.cn.common.processor;

import com.cn.msg.Message;

import java.nio.charset.Charset;

public abstract class AbstractProcessor {

    public Message decodeBody(Message message) {
        return message.setBody(new String(message.getByteBodys(), Charset.forName("utf-8")));
    }

    byte[] autoOks = new String("ok").getBytes(Charset.forName("utf-8"));

    public Message autoOk(Message message) {
        message.setByteBodys(autoOks);
        message.setLength(message.getByteBodys().length);
        return message;
    }

}
